Repository navigation
fix(android): don't count the keyboard against maxContentHeight - #1017
Conversation
getDetentHeight added the keyboard inset to the detent height and then applied maxContentHeight, so the keyboard used up the content cap. A sheet whose content plus keyboard exceeded maxContentHeight stopped at the cap and the keyboard covered the bottom of its content, e.g. a submit button below a text input. iOS caps the content and lifts the sheet above the keyboard. Cap the content height first, then add the keyboard, still clamped to the screen. With no keyboard the result is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@wildseansy is attempting to deploy a commit to the lodev09 Team on Vercel. A member of the Team first needs to authorize it. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nt-height-keyboard # Conflicts: # CHANGELOG.md
|
Thanks! I reproduced this on Repro: an
The new order (footer overlap, then the I pushed a few commits to your branch:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
On Android,
maxContentHeightcapped the sheet's content plus the keyboard.getDetentHeightadded the keyboard inset to the detent height and then appliedmaxContentHeight, so the keyboard used up the cap. When content + keyboard exceededmaxContentHeight, the sheet stopped at the cap and the keyboard covered the bottom of the content, e.g. a submit button below aTextInputin a content-sized (auto) sheet.iOS caps the content and lifts the sheet above the keyboard, and the docs describe
maxContentHeightas "the absolute maximum height of the sheet content". This change does the same on Android: the footer–keyboard overlap andmaxContentHeightapply to the content first, then the keyboard is added, still clamped to the screen.maxContentHeight, the result is unchanged.realScreenHeight - topInset, so a tall sheet stops below the status bar. There, the existing scrollable keyboard inset lets the content scroll above the keyboard, as on iOS.Type of Change
Test Plan
Tested in an app on React Native 0.88 with true-sheet 4.0.1 plus this change, on an Android emulator (Pixel 8, API 36, Gboard). The sheet is a content-sized (
auto) sheet withmaxContentHeight= 75% of the window, holding a title, a multilineTextInputand a button below it.scrollableRefscrolls the button above the keyboard.Screenshots / Videos
Same sheet, same device (1080x2340, density 480, font scale 1.15), keyboard up:
Checklist